#ifndef RecordCameraHandler_H
#define RecordCameraHandler_H

#include <amk3/amk3.h>
#include <osgGA/GUIEventHandler>
#include <osgGA/GUIEventAdapter>
#include <osgGA/GUIActionAdapter>
#include <osg/Vec3>

class RecordCameraHandler : public osgGA::GUIEventHandler
{
public:
	class RecordCameraData {
		osg::Vec3 position;
		osg::Vec3 hpr;
	};
	class RecordCameraOperation : public osg::Referenced
	{
	public:
		virtual void operator()(const RecordCameraData& rcd) = 0;
	};

public:

	virtual bool handle(const osgGA::GUIEventAdapter&, osgGA::GUIActionAdapter&) override;

	inline void setCaptureOperation(RecordCameraOperation* operation) { _operation = operation; }
	inline RecordCameraOperation* getCaptureOperation() const { return _operation.get(); }

	void start();
	void stop();

protected:
	osg::ref_ptr<RecordCameraOperation>          _operation;
	//osg::ref_ptr<osg::Camera::DrawCallback>      _callback;
};


#endif

